package com.pricl.frame.core;

import java.io.Serializable;
import java.util.Arrays;

/**
 * <p>
 * 上下文user类
 * </p>
 * 
 * @author cheng(iknoweth@yahoo.com)
 * @date 2016-5-4 下午10:18:34
 */
public class User implements Serializable {

	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", password=" + password + ", salt=" + salt
				+ ", plaintext=" + plaintext + ", name=" + name + ", userType=" + userType + ", roles="
				+ Arrays.toString(roles) + ", perms=" + Arrays.toString(perms) + "]";
	}

	private static final long serialVersionUID = 1L;

	/** 用户id **/
	public Long id;

	/** 用户名 **/
	public String username;

	/** 密码md5 **/
	public String password;

	/** 盐 **/
	public String salt;

	/** 密码明文 **/
	public String plaintext;

	/** 姓名 **/
	public String name;

	/** 用户类型 :1-管理员，3-普通用户，5-大咖 **/
	public Integer userType;
	
	/** 角色 **/
	public Long[] roles;

	/** 权限 **/
	public String[] perms;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public String getPlaintext() {
		return plaintext;
	}

	public void setPlaintext(String plaintext) {
		this.plaintext = plaintext;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String[] getPerms() {
		return perms;
	}

	public void setPerms(String[] perms) {
		this.perms = perms;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long[] getRoles() {
		return roles;
	}

	public void setRoles(Long[] roles) {
		this.roles = roles;
	}

	public Integer getUserType() {
		return userType;
	}

	public void setUserType(Integer userType) {
		this.userType = userType;
	}

}
